$(function () {
    $('#confirm').click(function () {
        var username = $('#username').val();
        var params = {
            'username': username,

        };
        $.ajax({
            url: '/usercenter/',
            type: 'post',
            contentType: 'application/json',
            data: JSON.stringify(params),
            success: function (data) {
                if (data.code = '0') {
                    alert('修改成功');
                    window.location.href = '/'
                } else {
                    alert('修改失败')
                }
            }

        })
    })
});

